// 表单转json对象
$.fn.serializeObject = function () {
    var o = {};
    var a = this.serializeArray();
    $.each(a, function () {
        if (o[this.name]) {
            if (!o[this.name].push) {
                o[this.name] = [o[this.name]];
            }
            o[this.name].push(this.value || '');
        } else {
            o[this.name] = this.value || '';
        }
    });
    return o;
};

//作用于form
$.fn.formReset = function () {
    this[0].reset();
};

function isEmpty(param) {
    if (param == null || param == '' || param == undefined) {
        return true;
    }
    else return false;
};

function hasAttr(obj,attr) {
    if (typeof(obj.attr(attr)) == "undefined")
        return false;
    else return true;
}

//自定义contain方法
Array.prototype.contain = function(val)
{
    for (var i = 0; i < this.length; i++)
    {
        if (this[i] == val)
        {
            return true;
        }
    }
    return false;
};
